package cn.hesion.designpattern.DelegatePattern;

import java.util.HashMap;
import java.util.Map;

public class Leader implements IEmployee{

    private Map<String,IEmployee> targets = new HashMap<>();
    public Leader(){
        targets.put("登录",new EmpolyeeA());
        targets.put("加密",new EmployeeB());
    }
    //经理只负责下达任务
    @Override
    public void doing(String command) {
        targets.get(command).doing(command);
    }
}
